<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>Adicionar Registro</h2>
    </div>
    <!-- End Box Head -->

    <form action="model.php" method="post">
        <!-- Form -->
        <div class="form">

            <?php
            $sql = 'select * from ' . $_SESSION['opcao'];

            $query = mysql_query($sql);

            while ($obj = mysql_fetch_field($query)) {

                echo ' <p>';
                echo ' <label>' . $obj->name . '</label>';
                echo ' <input type="text" class="field size1" name="' . $obj->name . '"/>';
                echo ' </p> ';

                // echo '<pre>';
                // print_r($obj);
            }
            ?>

            <input type="hidden" name="op" value="I"/>

        </div>
        <!-- End Form -->

        <!-- Form Buttons -->
        <div class="buttons">
            <input type="button" class="button" value="Limpar" />
            <input type="submit" class="button" value="Gravar" />
        </div>
        <!-- End Form Buttons -->
    </form>
</div>
<!-- End Box -->
